#include<iostream>
#include<unistd.h>
#include<pthread.h>
#include<cstring>
#include<cstdlib>

using namespace std;

#define MAX 10

void* _start_test(void* arg){

    while(true){
        sleep(1);
        cout << (char*)arg <<endl;
    }
    return nullptr;
}


int main(){

    
    for (int i = 0; i<MAX; i++){
        pthread_t tid;
        char buff[64];
        snprintf(buff, sizeof(buff), "this is %d thread", i);
        pthread_create(&tid, nullptr, _start_test, buff);
        
    }

    char buff[64] = "你的内容被我篡改了";
    while(true){
        sleep(1);
        cout << "我是主线程"<<endl;
    }

    return 0;
}